package com.han.hotelplat.dao.wallet;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.han.hotelplat.comm.base.BaseDAO;
import com.han.hotelplat.comm.utils.MD5;
import com.han.hotelplat.pojo.wallet.Wallet;

@Repository
public class WalletDao extends BaseDAO<Wallet>{
	
	public Wallet getMyWallet(String userid){
		List<Wallet> li = findByProperty("userid", userid);
		if(li.size() == 0){
			return null;
		}
		return li.get(0);
	}

	public void setPaypassword(Wallet wallet, String password) {
		wallet.setPaypassword(MD5.toMD5(password));
		update(wallet);
	}
	
}
